﻿using System.Web.Mvc;

namespace Company.Web.Areas.Manage
{
    public class ManageAreaRegistration : AreaRegistration
    {
        public override string AreaName
        {
            get
            {
                return "Manage";
            }
        }

        public override void RegisterArea(AreaRegistrationContext context)
        {
            string path = Global.ManagePath;
            string ext = Global.UrlRewrite ? Global.UrlExt : string.Empty;

            context.MapRoute(
                "Manage_Images_Index3",
                path + "/images/index/{id}" + ext,
                new { controller = "images", action = "index" },
                new string[] { "Company.Web.Areas.Manage.Controllers" }
                );

            //context.MapRoute(
            //    "Manage_Images_Index2",
            //    path + "/images/index/{a}/{id}" + ext,
            //    new { controller = "images", action = "index" },
            //    new string[] { "Company.Web.Areas.Manage.Controllers" }
            //    );

            //context.MapRoute(
            //    "Manage_Images_Index1",
            //    path + "/images/index/{b}/{a}/{id}" + ext,
            //    new { controller = "images", action = "index" },
            //    new string[] { "Company.Web.Areas.Manage.Controllers" }
            //    );


            context.MapRoute(
                "Manage_ext_2_3",
                path + "/{controller}/{action}/{id}/{a}/{b}" + ext,
                new { controller = "home", action = "index" },
                new string[] { "Company.Web.Areas.Manage.Controllers" }
            );
            context.MapRoute(
                "Manage_ext_2_2",
                path + "/{controller}/{action}/{id}/{a}" + ext,
                new { controller = "home", action = "index" },
                new string[] { "Company.Web.Areas.Manage.Controllers" }
            );
            context.MapRoute(
                "Manage_ext_2_1",
                path + "/{controller}/{action}/{id}" + ext,
                new { controller = "home", action = "index" },
                new string[] { "Company.Web.Areas.Manage.Controllers" }
            );
            context.MapRoute(
                "Manage_ext_1",
                path + "/{controller}" + ext,
                new { controller = "home", action = "index" },
                new string[] { "Company.Web.Areas.Manage.Controllers" }
            );
            context.MapRoute(
                "Manage_ext_3",
                path + "/{controller}/{action}" + ext,
                new { controller = "home", action = "index" },
                new string[] { "Company.Web.Areas.Manage.Controllers" }
            );

            //context.MapRoute(
            //    "Manage_d_1",
            //    path + "/{controller}"+ext,
            //    new { controller = "home", action = "index", id = UrlParameter.Optional },
            //    new string[] { "Company.Web.Areas.Manage.Controllers" }
            //);

            //context.MapRoute(
            //    "Manage_d_2",
            //    path + "/{controller}/{action}"+ext,
            //    new { controller = "home", action = "index", id = UrlParameter.Optional },
            //    new string[] { "Company.Web.Areas.Manage.Controllers" }
            //);

            context.MapRoute(
                "Manage_default",
                path + "/{controller}/{action}/{id}",
                new { controller = "home", action = "index", id = UrlParameter.Optional },
                new string[] { "Company.Web.Areas.Manage.Controllers" }
            );
        }
    }
}
